﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Bastanteo.Domain.Usuario>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="98%" border=0 cellpadding="0" cellspacing="0" align="center">
	    <tr align="center">		
		    <td class="titulon" valign="middle">Mantenimiento de Usuarios</td>
	    </tr>			
    </table>
    <br />
    <form id="frmBuscar" action="/Usuario/Buscar" method="post">
    <table align="center" width="400px" border="0" cellpadding="1" cellspacing="1" >
        <tr>
            <td class="tdlabelForm" style="width: 80px; text-align: right;">Código&nbsp;:&nbsp;</td>
            <td class="tdlabelForm" >
                <input type="text" name="txtBuscarCod" style=" width=50px;  text-transform :uppercase"  class="tdlabelForm"  />&nbsp;&nbsp;
            </td>
            <td class="tdlabelForm" style="width: 100px; text-align: right;">Usuario&nbsp;:&nbsp;</td>
            <td class="tdlabelForm" >
                <input type="text" name="txtBuscarUsu" size="25" style="text-transform :uppercase"  class="tdlabelForm" Width="100px"/> &nbsp;&nbsp;
            </td>
            <td class="tdlabelForm" style="width: 100px; text-align: right;">Rol&nbsp;:&nbsp;</td>
            <td class="tdlabelForm" style="width: 200px; text-align: right;">
            <%: Html.DropDownList("RolCodigo", (IEnumerable<SelectListItem>)TempData["Roles"]) %>
            </td>&nbsp;
            <td>
                <input type="submit" value="Buscar" Class="btnout" Width="70px"/>
            </td>
        </tr>
    </table>

    </form>

    <center> <p style="color:Blue"><%: TempData["mensaje"] %></p> </center>
    <table class="tABLAxml" align="center">
        <tr>
            <th Class="tituloXML"></th>
            <th Class="tituloXML" width="80px" align="center">Código</th>
            <th Class="tituloXML" width="150px">Usuario</th>
            <th Class="tituloXML" width="150px">Rol</th>
        </tr>

    <% foreach (var item in Model) { %>
        <tr>
            <td Class="celdaXML">
                <%: Html.ActionLink("Modificar", "Modificacion", new { codigo = item.UsuarioId }) %> |
                <%: Html.ActionLink("Ver", "Visualizacion", new { codigo = item.UsuarioId })%> |
                <%: Html.ActionLink("Eliminar", "Eliminacion", new { codigo = item.UsuarioId })%>
            </td>
            <td Class="celdaXML" align="center">
                <%: item.Codigo %>
            </td>
            <td Class="celdaXML">
                <%: item.usuario %>
            </td>
            <td Class="celdaXML">
                <%: item.Rol.RolDescripcion %>
            </td>
        </tr>
    
    <% } %>
    <tr>
        <td colspan=4 class="celdaLink" >
            <%: Html.ActionLink("Crear", "Creacion") %>
        </td>
    </tr>

    </table>
</asp:Content>

